package com.tchhy.provider.api.partnerapi

import com.tchhy.provider.URLConstant
import com.tchhy.provider.data.common.BaseResp
import com.tchhy.provider.data.common.EmptyResp
import com.tchhy.provider.data.partner.response.MedicineDetailResp
import com.tchhy.provider.data.partner.MedicineKitSalesInfo
import com.tchhy.provider.data.partner.request.ApplyDrugExaminationListResponseInfo
import com.tchhy.provider.data.partner.response.*
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.*

/**
 * @author: admin
 * @date: 2019/8/20
 * @des: 工作模块
 *
 **/
interface WorkApi {

    /**
     * @description 申请列表
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    @GET(URLConstant.APPLY_LIST)
    fun fetchMedicineApplyList(@Query("pageNum") pageNum: Int, @Query("pageSize") pageSize: Int): Observable<BaseResp<DataListRes<ApplyMedicineRes>>>

    /**
     * @description 申请/审批详情
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    @GET(URLConstant.APPLY_DRUG_DETAIL)
    fun applyDrugDetail(@Query("id") id: String): Observable<BaseResp<ApplyMedicineRes>>

    /**
     * @description 审批列表
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    @GET(URLConstant.APPLY_EXAMINATION_LIST)
    fun examinationList(): Observable<BaseResp<DataListRes<ApplyDrugExaminationListResponseInfo>>>
//-----------------------------------------------------------------------用户---------------------------------------------------------------------

    /**
     * @description 提交用户信息
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    @POST(URLConstant.SUBMIT_PURCHASE_INFO)
    fun commitUserInfo(): Observable<EmptyResp>

//---------------------------------------------------------------------药箱---------------------------------------------------------------------------

    /**
     * @description 填写购买人信息
     * @param
     * @return
     * @author admin
     * @time 2019/8/22
     */
    @POST(URLConstant.SUBMIT_PURCHASE_INFO)
    fun submitPurchaseInfo(@Body body: RequestBody): Observable<EmptyResp>


    /**
     * @description 获取合伙人的省市区
     * @param
     * @return
     * @author admin
     * @time 2019/8/22
     */
    @GET(URLConstant.GET_PARTNER_AREA)
    fun getPartnerArea(): Observable<BaseResp<PartnerAreaRes>>

    /**
     * @description 药箱销售记录
     * @param
     * @return
     * @author admin
     * @time 2019/8/21
     */
    @FormUrlEncoded
    @POST("")
    fun getMedicineKitSales(): Observable<BaseResp<MedicineKitSalesInfo>>


    /**
     * @description 获取支付码地址
     * @param
     * @return
     * @author admin
     * @time 2019/8/22
     */
    @POST(URLConstant.QRCODE_AND_PAYMENTID)
    fun getPaymentCode(@Body body: RequestBody): Observable<BaseResp<PaymentCodeInfo>>

    /**
     * @description 审批列表
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    @GET(URLConstant.APPLY_EXAMINATION_LIST)
    fun fetchMedicineApprovalList(@Query("pageNum") pageNum: Int, @Query("pageSize") pageSize: Int, @Query("status") status: Int): Observable<BaseResp<DataListRes<ApprovalItemRes>>>

    /**
     * @description 获取订单列表
     * @param
     * @return
     */
    @GET(URLConstant.SERVICE_ORDERS)
    fun getServiceOrderList(@Query("pageNum") pageNum: Int, @Query("pageSize") pageSize: Int): Observable<BaseResp<ServiceOrdersRes>>



    /**
     * @description 获取订单详情
     * @param
     * @return
     * @author admin
     * @time 2019/8/22
     */
    @GET(URLConstant.SERVICE_ORDERS_DETAIL)
    fun getServiceOrder(@Query("orderId") orderId: String): Observable<BaseResp<ServiceOrderDetailRes>>

    /**
     * @description 获取支付结果
     * @param
     * @return
     * @author admin
     * @time 2019/8/23
     */
    @GET(URLConstant.PAYMENT_RESULT)
    fun getPaymentResult(@Query("paymentId") paymentId: String): Observable<BaseResp<PaymentResultRes>>

    /**
     * @description 保存支付结果信息
     * @param
     * @return
     * @author admin
     * @time 2019/8/23
     */
    @POST(URLConstant.SAVE_PAYMENT_INFO)
    fun savePaymentInfo(@Body body: RequestBody): Observable<BaseResp<SavePaymentRes>>

    /**
     * @description 审批他人结果
     * @param
     * @return
     * @author admin
     * @time 2019/8/24
     */
    @POST(URLConstant.APPROVAL_MEDICINE)
    fun approvalMedicineApply(@Body body: RequestBody): Observable<EmptyResp>

    /**
     * @description 申请药箱的信息
     * @param
     * @return
     * @author admin
     * @time 2019/8/24
     */
    @GET(URLConstant.APPLYORDER_GETRECIPIENT)
    fun getApplyMedicineInfo(): Observable<BaseResp<ApplyReciveAddress>>

    /**
     * @description 提交申请
     * @param
     * @return
     * @author admin
     * @time 2019/8/24
     */
    @POST(URLConstant.APPLYORDER_COMMIT)
    fun commitApply(@Body body: RequestBody): Observable<BaseResp<CommitApplyRes>>

    /**
     * @description 提交申请
     * @param
     * @return
     * @author admin
     * @time 2019/8/24
     */
    @GET(URLConstant.MEDICINE_KITINFO)
    fun getMedicineKitDetail(@QueryMap map: Map<String,String>): Observable<BaseResp<MedicineDetailResp>>



}